package com.waiting.date;

import java.util.Calendar;
import java.util.Date;

/**
 * @author bjweitingting
 * @desctiption
 * @date 2018/6/28
 **/
public class CalendarMain {
    public static void main(String[] args) {
//        test1();
        test2();
        System.out.println(getTomorrowStart());
    }

    public static void test1() {
        Calendar calenDarFuture = Calendar.getInstance();
        calenDarFuture.add(Calendar.DAY_OF_MONTH, 30);
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar.getTime().toString());
    }

    public static void test2() {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        System.out.println(calendar.getTime().toString());
    }

    public static Date getTomorrowStart() {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.add(Calendar.DATE, 1);
        return calendar.getTime();
    }

}
